package com.grao.waterschool.human.entiry.dto;

import com.grao.waterschool.human.entiry.po.TSysTuser;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springdoc.api.annotations.ParameterObject;

@Data
@ParameterObject
public class CreateUserDTO {


    @Schema(description = "ID")
    private Integer id;

    /**
     * 教职工号
     */
    @Schema(description = "教职工号")
    private String teacherNum;

    /**
     * 用户名。用于登录
     */
    @Schema(description = "用户名。用于登录")
    private String userName;

    /**
     * 教职工姓名
     */
    @Schema(description = "教职工姓名")
    private String nickName;

    /**
     * 密码
     */
    @Schema(description = "密码")
    private String pwd;

    /**
     * 教职工电话
     */
    @Schema(description = "教职工电话")
    private String phone;

    /**
     * 教职工邮箱
     */
    @Schema(description = "教职工邮箱")
    private String email;

    public TSysTuser toCreateUser() {
        TSysTuser user = new TSysTuser();
        user.setId(getId());
        user.setTeacherNum(getTeacherNum());
        user.setTusername(getUserName());
        user.setTphone(getPhone());
        user.setTpassword(getPwd());
        user.setTnickname(getNickName());
        user.setTemail(getEmail());
        return user;
    }

}
